// ----------------------------------------------------------------------------
//
// Interface for defining the objects required to save data into a data store.
//
// ----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
using System.Data;

namespace WERServices
{
    /// <summary>
    /// Interface that defines the objects required to save data into a data store.
    /// The objects would include method to add a parameter and a method to save the data
    /// in the parameters.
    /// </summary>
    public interface IDataStore
    {
        /// <summary>
        /// Method to add a stored procedure parameter to the parameter list.
        /// </summary>
        /// <param name="parameterName">Name of the paramerer.</param>
        /// <param name="type">Data type of the parameter.</param>
        /// <param name="size">Size of the parameter.</param>
        /// <param name="value">Value of the parameter.</param>
        /// <param name="clearList">Boolean to decide whether to clear the parameter list before adding the parameter.</param>
        void AddParameter(string parameterName, string type, int size, object value, bool clearList);

        /// <summary>
        /// Method to save the data to the database.
        /// </summary>
        /// <param name="commandName">Name of the object to call (stored procedure name) to store the data.</param>
        /// <param name="connectionString">Connection string to the database.</param>
        void SaveData(string commandName, string connectionString);

        /// <summary>
        /// Method to read the data out of the database.
        /// </summary>
        /// <param name="commandName">Name of the object to call (stored procedure name) to read the data from the database.</param>
        /// <param name="connectionString">Connection string to the database.</param>
        /// <returns>Returns a DataSet object containing the data.</returns>
        DataSet ReadData(string commandName, string connectionString);
    }
}
